3.3 \(\int \cot (c+d x) (a+b \tan (c+d x)) (B \tan (c+d x)+C \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=42 \[ -\frac{(a C+b B) \log (\cos (c+d x))}{d}+x (a B-b C)+\frac{b C \tan (c+d x)}{d} \]

[Out]

(a*B - b*C)*x - ((b*B + a*C)*Log[Cos[c + d*x]])/d + (b*C*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0604294, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3632, 3525, 3475} \[ -\frac{(a C+b B) \log (\cos (c+d x))}{d}+x (a B-b C)+\frac{b C \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]*(a + b*Tan[c + d*x])*(B*Tan[c + d*x] + C*Tan[c + d*x]^2),x]

[Out]

(a*B - b*C)*x - ((b*B + a*C)*Log[Cos[c + d*x]])/d + (b*C*Tan[c + d*x])/d

Rule 3632

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)
*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[1/b^2, Int[(a + b*Tan[e + f*x])
^(m + 1)*(c + d*Tan[e + f*x])^n*(b*B - a*C + b*C*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, m,
 n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \cot (c+d x) (a+b \tan (c+d x)) \left (B \tan (c+d x)+C \tan ^2(c+d x)\right ) \, dx &=\int (a+b \tan (c+d x)) (B+C \tan (c+d x)) \, dx\\ &=(a B-b C) x+\frac{b C \tan (c+d x)}{d}+(b B+a C) \int \tan (c+d x) \, dx\\ &=(a B-b C) x-\frac{(b B+a C) \log (\cos (c+d x))}{d}+\frac{b C \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0538475, size = 59, normalized size = 1.4 \[ a B x-\frac{a C \log (\cos (c+d x))}{d}-\frac{b B \log (\cos (c+d x))}{d}-\frac{b C \tan ^{-1}(\tan (c+d x))}{d}+\frac{b C \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]*(a + b*Tan[c + d*x])*(B*Tan[c + d*x] + C*Tan[c + d*x]^2),x]

[Out]

a*B*x - (b*C*ArcTan[Tan[c + d*x]])/d - (b*B*Log[Cos[c + d*x]])/d - (a*C*Log[Cos[c + d*x]])/d + (b*C*Tan[c + d*
x])/d

________________________________________________________________________________________

Maple [A]  time = 0.061, size = 66, normalized size = 1.6 \begin{align*} aBx-Cbx-{\frac{Bb\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}+{\frac{Bac}{d}}+{\frac{Cb\tan \left ( dx+c \right ) }{d}}-{\frac{Ca\ln \left ( \cos \left ( dx+c \right ) \right ) }{d}}-{\frac{Cbc}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x)

[Out]

a*B*x-C*b*x-1/d*B*b*ln(cos(d*x+c))+1/d*B*a*c+b*C*tan(d*x+c)/d-1/d*C*a*ln(cos(d*x+c))-1/d*C*b*c

________________________________________________________________________________________

Maxima [A]  time = 1.75158, size = 68, normalized size = 1.62 \begin{align*} \frac{2 \, C b \tan \left (d x + c\right ) + 2 \,{\left (B a - C b\right )}{\left (d x + c\right )} +{\left (C a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*(2*C*b*tan(d*x + c) + 2*(B*a - C*b)*(d*x + c) + (C*a + B*b)*log(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.35061, size = 122, normalized size = 2.9 \begin{align*} \frac{2 \,{\left (B a - C b\right )} d x + 2 \, C b \tan \left (d x + c\right ) -{\left (C a + B b\right )} \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*(2*(B*a - C*b)*d*x + 2*C*b*tan(d*x + c) - (C*a + B*b)*log(1/(tan(d*x + c)^2 + 1)))/d

________________________________________________________________________________________

Sympy [A]  time = 2.89056, size = 82, normalized size = 1.95 \begin{align*} \begin{cases} B a x + \frac{B b \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{C a \log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - C b x + \frac{C b \tan{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (a + b \tan{\left (c \right )}\right ) \left (B \tan{\left (c \right )} + C \tan ^{2}{\left (c \right )}\right ) \cot{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)**2),x)

[Out]

Piecewise((B*a*x + B*b*log(tan(c + d*x)**2 + 1)/(2*d) + C*a*log(tan(c + d*x)**2 + 1)/(2*d) - C*b*x + C*b*tan(c
 + d*x)/d, Ne(d, 0)), (x*(a + b*tan(c))*(B*tan(c) + C*tan(c)**2)*cot(c), True))

________________________________________________________________________________________

Giac [A]  time = 1.42125, size = 68, normalized size = 1.62 \begin{align*} \frac{2 \, C b \tan \left (d x + c\right ) + 2 \,{\left (B a - C b\right )}{\left (d x + c\right )} +{\left (C a + B b\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)*(a+b*tan(d*x+c))*(B*tan(d*x+c)+C*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(2*C*b*tan(d*x + c) + 2*(B*a - C*b)*(d*x + c) + (C*a + B*b)*log(tan(d*x + c)^2 + 1))/d